Skip to content

test(snap): add pnpm v11 snap tests for command adaptation coverage#1289

Draft
fengmk2 wants to merge 6 commits intomainfrom
pnpm-v11-snap-tests
Draft

test(snap): add pnpm v11 snap tests for command adaptation coverage#1289
fengmk2 wants to merge 6 commits intomainfrom
pnpm-v11-snap-tests

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Apr 3, 2026

Add 26 snap test cases for pnpm@11.0.0-rc.5, mirroring the existing pnpm10 test suite, to validate vp's command-adaptation layer against the upcoming pnpm v11 release.

Coverage

New snap-tests-global/*-pnpm11 fixtures for: add, cache, config, dedupe, dlx, link, list, outdated, owner, pack, prune, publish, remove, unlink, update, view, vpx, why, dev-engines-runtime — plus workspace variants for add/list/outdated/pack/remove/update/why.

pnpm v11 compatibility findings

  • cache, dlx, owner, view, vpx — output identical to pnpm v10.
  • add, install, link — now report packageManagerDependencies (@pnpm/exe, pnpm) as part of install output; captured in snapshots.
  • why — output format restructured from tree-based to flat; captured in snapshots.
  • publish --dry-run — pnpm v11 no longer delegates to npm; minor output diff captured.
  • unlink (workaround applied) — pnpm v11 now runs a reconciling install after removing the override from pnpm-workspace.yaml. Under CI=true this defaults to --frozen-lockfile and fails with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH. Fix: snap tests pass -- --no-frozen-lockfile to vp unlink.
  • config at project scope (workaround applied) — pnpm v11 moved project config from .npmrc into pnpm-workspace.yaml, which only accepts camelCase keys. Test key renamed to vitePlusPmConfigTestKey.
  • dev-engines-runtime — bumped pinned Node.js to 22.22.2 to satisfy vp's current minimum (^20.19.0 || >=22.12.0).
  • prune — skipped on win32 (platform-specific output instability, matches other tests).

Global install is not affected — vp install -g already forces npm.

RFC updates

Added pnpm@11.x [WIP] entries to the Test Package Manager Versions sections of 7 RFCs: add-remove, dedupe, install, link-unlink, outdated, update, why. The link-unlink entry documents the -- --no-frozen-lockfile requirement under CI.

Test plan

  • pnpm -F vite-plus snap-test-global pnpm11 — all 26 cases pass with clean exit codes
  • cargo test -p vite_install --lib commands::unlink — unit tests still pass
  • CI green on all platforms

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 3, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit c0f9791
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69e9b98f1e8902000860b524

@fengmk2 fengmk2 self-assigned this Apr 3, 2026
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 3, 2026


How to use the Graphite Merge Queue

Add the label auto-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Add 26 snap test cases for pnpm@11.0.0-beta.6, mirroring the existing
pnpm10 test suite, to ensure command adaptation stability as pnpm v11
approaches release. Notable differences captured:
- link/unlink fails with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH
- `pnpm why` output format restructured
- `packageManagerDependencies` now appear in install output
- cache, dlx, owner, view, vpx output remain identical
@fengmk2 fengmk2 force-pushed the pnpm-v11-snap-tests branch from 155a35d to 733d977 Compare April 23, 2026 05:49
@fengmk2
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 23, 2026

fengmk2 added 3 commits April 23, 2026 13:56
Bump all 26 pnpm11 snap test cases to pnpm@11.0.0-rc.5 and regenerate
snap.txt. The ERR_PNPM_LOCKFILE_CONFIG_MISMATCH issue in link/unlink
persists in rc.5, confirming it's a stable v11 behavioral change.
pnpm v11 made `pnpm unlink` actually perform a reconciling install
after removing the override from pnpm-workspace.yaml. Under CI=true
the install defaults to --frozen-lockfile, which fails with
ERR_PNPM_LOCKFILE_CONFIG_MISMATCH because the lockfile still carries
the override that was just removed.

Pass `--no-frozen-lockfile` through to pnpm in the two affected snap
tests and note the requirement in the RFC's supported-versions list.

Also adds pnpm@11.x entries to the Test Package Manager Versions
sections of 7 RFCs covering add/remove/install/update/outdated/why/
dedupe/link-unlink.
The 22.11.0 pin inherited from the pnpm10 variant predates vp's
current minimum (^20.19.0 || >=22.12.0), causing the dlx step to
fail with an incompatible-node error. Bump to the latest v22 LTS.
@fengmk2
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 23, 2026

@cursor review

pnpm v11 moved project-scope config from .npmrc into
pnpm-workspace.yaml, which only accepts camelCase keys. The inherited
kebab-case key tripped ERR_PNPM_CONFIG_SET_UNSUPPORTED_WORKSPACE_KEY.
Rename the test key to vitePlusPmConfigTestKey so set/get/delete
round-trip cleanly.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c4e9579. Configure here.

Comment thread packages/cli/snap-tests-global/command-add-pnpm11/snap.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant